package service.impl;

import dao.ArithmeticDao;
import dao.impl.ArithmeticDeliveryDaoImpl;
import service.ArithmeticService;

public class ArithmeticServiceImpl implements ArithmeticService {
    // cglib动态代理实现
    private ArithmeticDao arithmeticDao=new ArithmeticDeliveryDaoImpl();
//    private ArithmeticDao arithmeticDao;
    public ArithmeticServiceImpl(){}
    public ArithmeticServiceImpl(ArithmeticDao arithmeticDao){
           this.arithmeticDao=arithmeticDao;
    }
    /**
     * 计算器方法
     *
     * @param num1
     * @param num2
     * @return
     */
    @Override
    public int calculator(int num1, int num2) {
        return arithmeticDao.calculator(num1, num2);
    }
    public void setArithmeticDao(ArithmeticDao arithmeticDao){
        this.arithmeticDao=arithmeticDao;
    }
}
